using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Serialization;
using System.IO;

namespace SerializationTestApp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Type t = typeof(Bitmap);
            textBox1.Text = t.AssemblyQualifiedName;
            //BinarySerializer s = new BinarySerializer();
            //TestClass2 c = new TestClass2("Test string", 24);
            //TestClass2[] a = new TestClass2[] { c, c };
            //using (MemoryStream ms = new MemoryStream())
            //{
            //    s.Serialize(ms, a);
            //    ms.Position = 0;
            //    textBox1.Text = BitConverter.ToString(ms.ToArray());
            //    TestClass2[] tc = (TestClass2[]) s.Deserialize(ms);
            //}
        }
    }

    
    [Serializable]
    public class TestClass1
    {
        private string _stringField;
        private int _intField;

        public TestClass1(string s, int i)
        {
            _stringField = s;
            _intField = i;
        }

        public TestClass1()
        {
        }

        public string StringField
        {
            get { return _stringField; }
        }

        public int IntField
        {
            get { return _intField; }
        }
    }

    
    [Serializable]
    public class TestClass2 : TestClass1
    {
        private float[] _floatField;
        private DateTime _dt = DateTime.Now;

        public TestClass2(string s, int i) : base(s, i)
        {
            _floatField = new float[] { 0.0f, 1.4f, 0.98763f };
        }

        public TestClass2()
        {
        }
    }
        
}